home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™ 1987-1994 / MacHack™ '91 / '91 Attendee Contributions / Rotate Src / Rotate.r < prev    next >
Encoding:
Text File  |  1990-12-17  |  3.4 KB  |  150 lines  |  [TEXT/MPS ]

  1. /*--------------------------------------------------------------------
  2.  
  3.       Rotate.r    -  Resources for Rotate Bitmaps
  4.  
  5. ---------------------------------------------------------------------*/
  6.  
  7. #include "Types.r"
  8. #include "Rotate.h"
  9.  
  10. /* These define's are used in the MENU resources to disable specific
  11.    menu items. */
  12. #define AllItems    0x7FFFFFFF    /* 31 flags */
  13. #define MenuItem2    0x0002
  14. #define MenuItem4    0x0008
  15.  
  16.  
  17. resource 'ALRT' (rMsg, "Message", purgeable) {
  18.     {kAlertTop,KAlertLeft,kAlertTop+kMsgHeight,KAlertLeft+kMsgWidth},
  19.     rMsg, {
  20.         OK, visible, silent;
  21.         OK, visible, silent;
  22.         OK, visible, silent;
  23.         OK, visible, silent
  24.     };
  25. };
  26.  
  27. resource 'DITL' (rMsg, "Message", purgeable) {
  28.     {
  29.         {kMsgButtonTop, kMsgOkLeft, kMsgButtonBottom, kMsgOkRight},
  30.         Button {enabled,"Continue"},
  31.         {kMsgTextTop, kMsgTextLeft, kMsgTextBottom, kMsgTextRight},
  32.         StaticText {disabled,"^0"}
  33.     }
  34. };
  35.  
  36. resource 'ALRT' (rAlert, "Error Alert", purgeable) {
  37.     {kAlertTop,KAlertLeft,kAlertTop+kAlertHeight,KAlertLeft+kAlertWidth},
  38.     rAlert, {
  39.         OK, visible, silent;
  40.         OK, visible, silent;
  41.         OK, visible, silent;
  42.         OK, visible, silent
  43.     };
  44. };
  45.  
  46. resource 'DITL' (rAlert, "Error Alert", purgeable) {
  47.     {
  48.         {kAlertButtonTop, kAlertOkLeft, kAlertButtonBottom, kAlertOkRight},
  49.         Button {enabled,"OK"},
  50.         {kAlertIconTop, kAlertIconLeft, kAlertIconBottom, kAlertIconRight},
  51.         Icon {disabled,0},
  52.         {kAlertTextTop, kAlertTextLeft, kAlertTextBottom, kAlertTextRight},
  53.         StaticText {disabled,"^0"}
  54.     }
  55. };
  56.  
  57. resource 'STR#' (rTextStr,"Text Strings") {
  58.     {
  59.     "Rotate a Bitmap\n\n"
  60.     "     Version 0.9\n"
  61.     "     © 1989 Bob Spence\n"
  62.     "     All rights reserved\n\n"
  63.     "Source Language: MPW C",
  64.     
  65.     "Sorry, can't find the Bell file\n"
  66.     "     or the Bell 'Pict' resource.",
  67.     }
  68. };
  69.  
  70. /* we use an MBAR resource to conveniently load all the menus */
  71.  
  72. resource 'MBAR' (rMenuBar, preload) {
  73.     { mApple, mFile, mImage, mRotate };    /* four menus */
  74. };
  75.  
  76. resource 'MENU' (mApple, "Apple", preload) {
  77.     mApple, textMenuProc,
  78.     AllItems & ~MenuItem2,    /* Disable item #2 */
  79.     enabled, apple,
  80.     {
  81.         "About Rotate…",
  82.             noicon, nokey, nomark, plain;
  83.         "-",
  84.             noicon, nokey, nomark, plain
  85.     }
  86. };
  87.  
  88. resource 'MENU' (mFile, "File", preload) {
  89.     mFile, textMenuProc,
  90.     AllItems & ~MenuItem2,    /* Disable item #2 */
  91.     enabled, "File",
  92.     {
  93.         "Quit",
  94.             noicon, nokey, nomark, plain
  95.     }
  96. };
  97.  
  98. resource 'MENU' (mImage, "Image", preload) {
  99.     mImage, textMenuProc,
  100.     AllItems & ~(MenuItem4),    /* Disable item #4 */
  101.     enabled, "Image",
  102.      {
  103.         "Garbage bits",
  104.             noicon, nokey, nomark, plain;
  105.         "Black",
  106.             noicon, nokey, nomark, plain;
  107.         "White",
  108.             noicon, nokey, nomark, plain;
  109.         "-",
  110.             noicon, nokey, nomark, plain;
  111.         "Bell",
  112.             noicon, "B", nomark, plain;
  113.         "Stretch Bell",
  114.             noicon, "S", nomark, plain
  115.     }
  116. };
  117.  
  118. resource 'MENU' (mRotate, "Rotate", preload) {
  119.     mRotate, textMenuProc,
  120.     AllItems & ~(MenuItem2),    /* Disable item #2 */
  121.     enabled, "Rotate",
  122.      {
  123.         "All Rotations",
  124.             noicon, "A", nomark, plain;
  125.         "-",
  126.             noicon, nokey, nomark, plain;
  127.         "Null Rotation",
  128.             noicon, nokey, nomark, plain;
  129.         "Horizontal",
  130.             noicon, nokey, nomark, plain;
  131.         "Vertical",
  132.             noicon, nokey, nomark, plain;
  133.         "Flip 180",
  134.             noicon, nokey, nomark, plain;
  135.         "Left",
  136.             noicon, nokey, nomark, plain;
  137.         "Right",
  138.             noicon, nokey, nomark, plain;
  139.         "Flip Left",
  140.             noicon, nokey, nomark, plain;
  141.         "Flip Right",
  142.             noicon, nokey, nomark, plain
  143.     }
  144. };
  145.  
  146. resource 'WIND' (128, preload, purgeable) {
  147.     {kWindowBase, 0, kWindowBase+kWindowHeight, kWindowWidth},
  148.     noGrowDocProc, visible, noGoAway, 0x0, "Rotate a Bitmap"
  149. };
  150.